def hanio(n, a, b, c):
    if n == 1:

        print(a, '----->', c)
    else:
        hanio(n - 1, a, c, b)
        hanio(1, a, b, c)
        hanio(n - 1, b, a, c)


def main():
    a = int(input())

    hanio(a, 'A', 'B', 'C')


main()
